import {
  Column,
  CreateDateColumn,
  DeleteDateColumn,
  Entity,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm'

@Entity({ synchronize: false })
export abstract class Operate {
  @PrimaryGeneratedColumn({ name: 'id', type: 'bigint' })
  id: string

  @Column({
    name: 'create_id',
    type: 'bigint',
    nullable: true,
    comment: '创建人id',
  })
  createId: string | null

  @Column({ name: 'create_by', type: 'varchar', length: 12, comment: '创建人', nullable: true })
  createBy: string | null

  @CreateDateColumn({ name: 'create_time', type: 'datetime', comment: '创建时间' })
  createTime: string | null

  @Column({ name: 'update_id', type: 'bigint', nullable: true, comment: '修改人id' })
  updateId: string | null

  @Column({ name: 'update_by', type: 'varchar', length: 12, nullable: true, comment: '修改人' })
  updateBy: string | null

  @UpdateDateColumn({ name: 'update_time', type: 'datetime', nullable: true, comment: '修改时间' })
  updateTime: string | null

  @Column({
    name: 'is_deleted',
    type: 'boolean',
    default: false,
    comment: '是否删除',
  })
  isDeleted: boolean

  @DeleteDateColumn({
    name: 'delete_time',
    nullable: true,
    type: 'datetime',

    comment: '删除时间',
  })
  deleteTime: string | null
}
